Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stock Prediction with CAPM and Fama-French Model #196

Merged
merged 2 commits into from
Oct 10, 2024
Merged

Stock Prediction with CAPM and Fama-French Model #196

merged 2 commits into from
Oct 10, 2024

Conversation

sharayuanuse
Copy link
Contributor

Related Issues or bug

This pull request addresses the issue related to implementing stock return prediction using the CAPM and Fama-French models for Mahindra company data. The primary challenge was to accurately predict stock returns and compare the accuracy of these two financial models based on historical stock data.

Fixes: #149

Proposed Changes

  • Implemented the Capital Asset Pricing Model (CAPM) for predicting stock returns.
  • Added the Fama-French Three-Factor Model to improve the prediction accuracy of stock returns.
  • Performed data analysis using Pandas and NumPy on historical stock data from Yahoo Finance.
  • Compared the models' performances by calculating R-squared and p-values for each.
  • Added visualizations using Matplotlib to showcase the comparison between predicted and actual returns.
  • Found that the Fama-French model outperforms CAPM by providing 36% greater accuracy in predicting Mahindra's stock returns.

Additional Info

  • Both models were tested on the same dataset for fair comparison.
  • The historical stock data was fetched from Yahoo Finance.
  • Statistical analysis (R-squared and p-values) was used to verify model accuracy.

Screenshots

output_1
output_2
output_3
output_4
output_5
output_6
output_7
output_8
output_9
output_10
output_11

output_12

Copy link

Thank you for submitting your pull request! 🙌 We'll review it as soon as possible. In the meantime, please ensure that your changes align with our CONTRIBUTING.md. If there are any specific instructions or feedback regarding your PR, we'll provide them here. Thanks again for your contribution! 😊

@UppuluriKalyani UppuluriKalyani merged commit 19d1558 into UppuluriKalyani:main Oct 10, 2024
3 checks passed
Copy link

🎉🎉 Thank you for your contribution! Your PR #196 has been merged! 🎉🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Predicting Stock Returns Using CAPM and Fama-French Models
2 participants